package org.smr.ministore.micro.client;

import org.blade.utils.Pager;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.smr.ministore.entities.GoodsTypePropsValue;
import org.springframework.stereotype.Component;

import java.util.Collections;
import java.util.List;
import java.util.Map;

import feign.hystrix.FallbackFactory;


@Component
public class HystrixGoodsTypePropsValueClientFactory implements FallbackFactory<FeignGoodsTypePropsValueMicroServiceClient> {

    private static final Logger LOGGER = LoggerFactory.getLogger(HystrixGoodsTypePropsValueClientFactory.class);

    @Override
    public FeignGoodsTypePropsValueMicroServiceClient create(Throwable cause) {
    HystrixGoodsTypePropsValueClientFactory.LOGGER.info("fallback; reason was: {}", cause.getMessage());

        return new FeignGoodsTypePropsValueMicroServiceClient() {

            @Override
            public int batchSave(List<GoodsTypePropsValue> entities) {
                return 0;
                }

            @Override
            public int batchModify(List<GoodsTypePropsValue> entities) {
                return 0;
                }

            @Override
            public int save(GoodsTypePropsValue entity) {
            return 0;
            }

            @Override
            public int updateById(GoodsTypePropsValue id) {
            return 0;
            }

            @Override
            public GoodsTypePropsValue queryById(Long id) {
            return null;
            }

            @Override
            public int deleteById(Long id) {
            return 0;
            }

            @Override
            public Pager<GoodsTypePropsValue> paginate(GoodsTypePropsValue entity, Long pageSize, Long pageNum) {
                Pager<GoodsTypePropsValue> pager = new Pager<GoodsTypePropsValue>();
                    return pager;
            }

        };//Return end
    }
}